#version 460
#define GLSLIFY 1
#define GLSLIFY 1

#define GLSLIFY 1
#define PROJECT_MATRIX

/*
0 投影矩阵
1 属性参数
2 变换数据
3 颜色数据

4 顶点数据
5 顶点配置参数


6 颜色控制参数

10 纹理数据

*/

layout(std140, set=0, binding=0) uniform U_Matrix {
	mat4 mat_ProjecView[2];
};

layout(std140, binding = 1) readonly buffer U1_Matrix {
	mat4 mat_Model[];
};

layout(std140, column_major, binding = 2) uniform U2_Matrix {
	//粒子颜色
	vec4 point_color;
};

layout(location = 0) in vec4	inDir_Speed;
//layout(location = 1) in float	inDensity;

layout(location = 0) out vec4 vColor;
out gl_PerVertex {
	vec4 gl_Position;
	float gl_PointSize;
};

void main(void){
	vec4 vert;
	
	vert.xyz = inDir_Speed.xyz;
	vert.w = 1.0;

	gl_Position = mat_ProjecView[0] * mat_Model[gl_InstanceIndex] * vert;
	//gl_Position = mat_ProjecView * vert;

	//gl_PointSize = inDir_Speed.w;
	gl_PointSize = 3.0;
	vColor.rgb = point_color.rgb;
	vColor.a = 1.0;
	
}

